(in-package :cl-user)
(defpackage woo.util
  (:use #:cl))
(in-package :woo.util)

(defun integer-string-p (string)
  (declare (type #+ecl string #-ecl simple-string string)
           (optimize (speed 3) (safety 2)))
  (when (zerop (length string))
    (return-from integer-string-p nil))
  (locally (declare (optimize (safety 0)))
    (let ((end (length string)))
      (declare (type integer end))
      (do ((i 0 (1+ i)))
        ((= i end) t)
        (declare (type integer i))
        (let ((char (aref string i)))
          (declare (type character char))
          (unless (char<= #\0 char #\9)
            (return-from integer-string-p nil)))))))
